<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>simHandleModule</title>
<link rel="stylesheet" type="text/css" href="../../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../../index.html" TARGET="_top"><img src="../images/homeImg.png"></a></p>

<h1><a href="../apiOverview.htm">Regular API</a> function</h1>
<h3 class=subsectionBar><a name="simHandleModule" id="simHandleModule"></a>simHandleModule / sim.handleModule </h3>
<table class=apiTable>
<tr class=apiTableTr> 
<td class=apiTableLeftDescr>
Description 
</td> 
<td class=apiTableRightDescr>Handles a plugin. This function is only available from the Lua API. Plugins, next to their registered custom Lua functions, might need to perform operations on a regular basis and not when called from a threaded script (e.g. for synchronization purposes). They can do it when <a href="simHandleModule.htm">sim.handleModule</a> is called (<a href="simOpenModule.htm">sim.openModule</a> should however have been called previously). Refer to the <a href="../apiConstants.htm#simulatorMessages">messages relayed to plugins</a> for more details. <a href="simHandleModule.htm">sim.handleModule</a> can only be called from the <a href="../mainScript.htm">main script</a> and is not available in the C-API. Look at the default main script to get an idea about how to use <a href="simOpenModule.htm">sim.openModule</a>, <a href="simHandleModule.htm">sim.handleModule</a> and <a href="simCloseModule.htm">sim.closeModule</a>.<br></td>
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCSyn>
C synopsis
</td> 
<td class=apiTableRightCSyn><div></div></td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCParam>C parameters</td> 
<td class=apiTableRightCParam>
<div></div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftCRet>
C return value
</td> 
<td class=apiTableRightCRet>
<div></div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLSyn>
Lua synopsis
</td> 
<td class=apiTableRightLSyn>
<div>(1) number result=sim.handleModule(number sim.handle_all,boolean calledInSensingPart)</div>
<div>(2) number result=sim.handleModule(string moduleName,boolean calledInSensingPart)</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLParam>Lua parameters</td> 
<td class=apiTableRightLParam>
<div><strong>sim.handle_all</strong>: indicates that all plugins should be handled (called)</div>
<div><strong>moduleName</strong>: the name of the plugin that should be handled (called)</div>
<div><strong>calledInSensingPart</strong>: set to false when called in the &quot;actuation part&quot;. Set to true when called in the &quot;sensing part&quot;</div>
</td> 
</tr> 
<tr class=apiTableTr> 
<td class=apiTableLeftLRet>
Lua return values
</td> 
<td class=apiTableRightLRet>
<div><strong>result</strong>: number of plugins that executed the command.</div>
</td> 
</tr> 
</table> 

<br>
<p><a href="../apiFunctions.htm">All regular API functions on one page</a></p>
<br>
<br>
</td>
</tr>
</table>
</div>
</body>
</html>
